﻿@model Core.Models.Domain

@{
    ViewBag.Title = "Edit Domain";
    List<Core.NameId> lYesNo = Core.Tools.YesNo();
    List<Core.NameId> sllist = new List<Core.NameId>();
    sllist.Add(new Core.NameId("F", "Free"));
    sllist.Add(new Core.NameId("P", "Personal"));
    sllist.Add(new Core.NameId("B", "Business"));
    sllist.Add(new Core.NameId("E", "Enterprise"));    
}

<h1>@ViewBag.Title</h1>

@using (Html.BeginForm()) {

    <table width="90%" cellpadding="5" cellspacing="0" border="0">
    <tr>
        <td colspan="2">
            @Html.ValidationSummary(false)
        </td>
    </tr>
    <tr>
        <td width="50%" valign="top">
            <fieldset>
                <legend>Domain Info</legend>
                @Html.HiddenFor(model => model.DomainId)
                @Html.HiddenFor(model => model.PrimaryBU)

                <div class="editor-label">
                    @Html.LabelFor(model => model.DomainName)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.DomainName)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.SiteTitle)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.SiteTitle)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.GoogleAnalyticsAccount)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.GoogleAnalyticsAccount)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.IsMultiBUYN)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.IsMultiBUYN, new SelectList(lYesNo, "Id", "Name", Model.IsMultiBUYN))
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.EnableSelfRegisterYN)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.EnableSelfRegisterYN, new SelectList(lYesNo, "Id", "Name", Model.EnableSelfRegisterYN))
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.ThemeId)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.ThemeId,new SelectList((List<Core.Models.Theme>)ViewBag.Themes,"ThemeId","Name",Model.ThemeId))
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.MobileThemeId)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.MobileThemeId,new SelectList((List<Core.Models.Theme>)ViewBag.MobileThemes,"ThemeId","Name",Model.MobileThemeId))
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.SubscriptionLevel)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.SubscriptionLevel,new SelectList(sllist,"Id","Name",Model.SubscriptionLevel))
                </div>
            </fieldset>
        </td>
        <td width="50%" valign="top">
            <fieldset>
                <legend>SMTP Settings</legend>

                <div class="editor-label">
                    @Html.LabelFor(model => model.SMTPServer)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.SMTPServer)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.SMTPPort)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.SMTPPort)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.SMTPUseSSLYN)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.SMTPUseSSLYN, new SelectList(lYesNo,"Id","Name", Model.SMTPUseSSLYN))
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.SMTPFrom)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.SMTPFrom)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.SMTPAccount)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.SMTPAccount)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.SMTPPassword)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.SMTPPassword)
                </div>

                <div class="editor-label">
                    @Html.LabelFor(model => model.SMTPAllowSendYN)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.SMTPAllowSendYN, new SelectList(lYesNo, "Id", "Name", Model.SMTPAllowSendYN))
                </div>
            </fieldset>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <h2>Primary Business Unit</h2>
            <hr />
        </td>
    </tr>
    <tr>
        <td colspan="2">
            @Html.EditorFor(model => model.PrimaryBusinessUnit)
        </td>
    </tr>
    <tr>
        <td colspan="2">
            &nbsp;
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <input type="submit" value="Save" /> |
            @Html.ActionLink("Back to List", "Index")
        </td>
    </tr>
    </table>
}

